﻿@model RightControl.WebApp.WebSiteModel
@{
    ViewBag.Title = @Model.SiteName;
}
<style type="text/css">
    .tpwthwidt .title_3yjHYH9 {
        color:#000 !important;
    }
    .tpwthwidt .text_3dzWiJR {
        color:#000 !important;
    }
    .tpwthwidt .textLeft_1LB3FB6 {
        color:#fff !important;
    }
</style>
<link href="~/Areas/Admin/Content/css/main.css" rel="stylesheet" />
<div class="layui-layout layui-layout-admin">
    <div class="layui-header header header-demo">
        <div class="layui-main">
            <div class="admin-login-box">
                <a class="logo" style="left: 0;" href="#">
                    <span style="font-size: 22px;">@Model.SiteName</span>
                </a>
                <div class="admin-side-toggle">
                    <i class="iconfont icon-ego-menu" aria-hidden="true"></i>
                </div>
            </div>
            <ul class="layui-nav admin-header-item">
                <li class="layui-nav-item" style="height:70px;display:inline-flex;">
                    <!--天气信息-->
                    <div id="tp-weather-widget"></div>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" class="admin-header-user">
                        <img src="@ViewBag.HeadShot" />
                        <cite>@ViewBag.RealName</cite>
                        <span class="layui-nav-more"></span>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;"><i class="iconfont icon-yonghu" aria-hidden="true"></i> 个人信息</a>
                        </dd>
                        <dd>
                            <a href="javascript:;"><i class="iconfont icon-shezhi" aria-hidden="true"></i> 设置</a>
                        </dd>
                        <dd>
                            <a href="/Admin/Login/OutLogin"><i class="iconfont icon-zhuxiaoguanji red" aria-hidden="true"></i> 注销</a>
                        </dd>
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav admin-header-item-mobile">
                <li class="layui-nav-item">
                    <a href="/Admin/Login/OutLogin"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-side layui-bg-black" id="admin-side">
        <div class="layui-side-scroll" id="admin-navbar-side" lay-filter="side"></div>
    </div>
    <div class="layui-body" style="bottom: 0;border-left: solid 2px #1AA094;" id="admin-body">
        <div class="layui-tab admin-nav-card layui-tab-brief" lay-filter="admin-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">
                    <i class="iconfont icon-zhuye" aria-hidden="true"></i>
                    <cite>控制面板</cite>
                </li>
            </ul>
            <ul id="rightmenu" class="layui-nav closeBox">
                <li class="layui-nav-item">
                    <div class="refresh larryms-press" id="larryms_refresh">
                        <i class="layui-icon layui-shuaxin">ဂ</i>
                        <cite>刷新</cite>
                    </div>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;"><i class="iconfont icon-shezhi" aria-hidden="true" style="font-size:16px;"></i> 页面操作<span class="layui-nav-more"></span></a>
                    <dl class="layui-nav-child" style="top:40px;">
                        @*<dd data-type="refreshCur"><a href="javascript:;"><i class="layui-icon" aria-hidden="true">ဂ</i> 刷新当前</a></dd>*@
                        <dd data-type="closethis"><a href="javascript:;"><i class="layui-icon" aria-hidden="true">&#x1007;</i> 关闭当前</a></dd>
                        <dd data-type="closeothers"><a href="javascript:;"><i class="layui-icon" aria-hidden="true">&#x1007;</i> 关闭其他</a></dd>
                        <dd data-type="closeall"><a href="javascript:;"><i class="layui-icon" aria-hidden="true">&#x1007;</i> 关闭全部</a></dd>
                    </dl>
                </li>
                @*<span class="layui-nav-bar"></span>*@
            </ul>
            <div class="layui-tab-content" style="min-height: 150px; padding: 5px 0 0 0;">
                <div class="layui-tab-item layui-show">
                    <iframe src="/Admin/Home/Main"></iframe>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-footer footer footer-demo" id="admin-footer">
        <div class="layui-main">
            <div>
                @Model.CopyRight
                <a href="Model.SiteDomain" target="_blank">@Model.SiteDomain</a>
            </div>
        </div>
    </div>
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>
    <script type="text/javascript" src="~/Areas/Admin/plugins/layui/layui.js"></script>
    <script src="~/Areas/Admin/datas/nav.js"></script>
    <script src="~/Areas/Admin/Content/js/index.js"></script>
    <!--天气 -->
    <script>(function(T,h,i,n,k,P,a,g,e){g=function(){P=h.createElement(i);a=h.getElementsByTagName(i)[0];P.src=k;P.charset="utf-8";P.async=1;a.parentNode.insertBefore(P,a)};T["ThinkPageWeatherWidgetObject"]=n;T[n]||(T[n]=function(){(T[n].q=T[n].q||[]).push(arguments)});T[n].l=+new Date();if(T.attachEvent){T.attachEvent("onload",g)}else{T.addEventListener("load",g,false)}}(window,document,"script","tpwidget","//widget.seniverse.com/widget/chameleon.js"))</script>
    <script>tpwidget("init", {
                        "container": "tp-weather-widget",
                        "color": "#FFFFFF",
                        "flavor": "slim",
                        "location": "WT33C6J2C563",
                        "geolocation": "enabled",
                        "language": "zh-chs",
                        "unit": "c",
                        "theme": "chameleon",
                        "bubble": "enabled",
                        "alarmType": "badge",
                        "uid": "U78371FB98",
                        "hash": "cd55c15865ecbe0f16ba78ca60ad51eb"
                    });
                    tpwidget("show");</script>
    <script>layui.use(['element'], function () {
            var $ = layui.jquery,
                element = layui.element;

					var tabDelete = function (id) {
					    console.log("删除的TabID：" + id)
					    element.tabDelete("admin-tab", id);//删除
					}
					var tabDeleteAll = function (ids) {
					    $.each(ids, function (i, item) {
					        element.tabDelete("admin-tab", item);
					    })
					}
					function refreshCurTab() {
					    var url = $("li[class='layui-this']").attr('lay-attr');
					    var curIframe = $("iframe[src='" + url + "']");
					    curIframe.attr("src", curIframe.attr("src"));//刷新框架
					}
					$("#larryms_refresh").click(function () {
					    refreshCurTab();
					});
				    /**
                     * 注册tab右键菜单点击事件
                     */
					$("#rightmenu li dd").click(function () {
					    var currentActiveTabID = $("li[class='layui-this']").attr('lay-id');// 获取当前激活的选项卡ID
					    var tabtitle = $(".layui-tab-title li");
					    var allTabIDArr = [];
					    $.each(tabtitle, function (i) {
					        allTabIDArr[i] = $(this).attr("lay-id");
					    })

					    switch ($(this).attr("data-type")) {
					        //case "refreshCur": //刷新当前选项卡
					        //    refreshCurTab();
					        //    break;
					        case "closethis"://关闭当前，如果开始了tab可关闭，实际意义不大
					            tabDelete(currentActiveTabID);
					            break;
					        case "closeall"://关闭所有
					            tabDeleteAll(allTabIDArr);
					            break;
					        case "closeothers"://关闭非当前
					            $.each(allTabIDArr, function (i) {
					                var tmpTabID = allTabIDArr[i];
					                if (currentActiveTabID != tmpTabID)
					                    tabDelete(tmpTabID);
					            })
					            break;
					        case "closeleft"://关闭左侧全部
					            var index = allTabIDArr.indexOf(currentActiveTabID);
					            tabDeleteAll(allTabIDArr.slice(0, index));
					            break;
					        case "closeright"://关闭右侧全部
					            var index = allTabIDArr.indexOf(currentActiveTabID);
					            tabDeleteAll(allTabIDArr.slice(index + 1));
					            break;
					        default:
					            $('.rightmenu').hide();

					    }
					    //$('#rightmenu').hide();
					})
				});</script>
</div>

